﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Threading.Tasks;
using NUnit.Framework;
using printer;
namespace employeetest
{
    [TestFixture]
   
   public class databasetest
    {
       
        [Test]
        public void check_connection_invaid()
        {

           
            Assert.IsFalse( DataBase.connect("ay7aga"));
        }

        [Test]
        public void check_connection_vaid()
        {


            Assert.IsTrue(DataBase.connect("Studio_Service_Company"));
        }
        String qurey_valid = "select * from Person ";
        String qurey_invalid = "select * from Emplo";
        [Test]
        public void test_select_valid()
        {

            SqlDataReader reader= DataBase.select_from_database(qurey_valid);
            bool row = reader.HasRows;
            Assert.IsTrue(row);
        }
    }




}
